package com.dhh.activity;

import com.dhh.R;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import greendroid.app.GDActivity;

public class ShowTopicActivity  extends GDActivity{
	@Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
		initActionBar();		

		String topic = this.getIntent().getStringExtra("topic");
		if(topic.equals("top_grain_1")){
			setActionBarContentView(R.layout.fg_grain_1);
		}else if(topic.equals("top_grain_2")){
			setActionBarContentView(R.layout.fg_grain_2);
		}else if(topic.equals("top_grain_3")){
			setActionBarContentView(R.layout.fg_grain_3);
		}else if(topic.equals("top_grain_4")){
			setActionBarContentView(R.layout.fg_grain_4);
		}else if(topic.equals("top_grain_5")){
			setActionBarContentView(R.layout.fg_grain_5);
		}else if(topic.equals("top_fruit_1")){
			setActionBarContentView(R.layout.fg_fruit_1);
		}else if(topic.equals("top_fruit_2")){
			setActionBarContentView(R.layout.fg_fruit_2);
		}else if(topic.equals("top_fruit_3")){
			setActionBarContentView(R.layout.fg_fruit_3);
		}else if(topic.equals("top_fruit_4")){
			setActionBarContentView(R.layout.fg_fruit_4);
		}else if(topic.equals("top_fruit_5")){
			setActionBarContentView(R.layout.fg_fruit_5);
		}else if(topic.equals("top_vegetable_1")){
			setActionBarContentView(R.layout.fg_vegetable_1);
		}else if(topic.equals("top_vegetable_2")){
			setActionBarContentView(R.layout.fg_vegetable_2);
		}else if(topic.equals("top_vegetable_3")){
			setActionBarContentView(R.layout.fg_vegetable_3);
		}else if(topic.equals("top_vegetable_4")){
			setActionBarContentView(R.layout.fg_vegetable_4);
		}else if(topic.equals("top_vegetable_5")){
			setActionBarContentView(R.layout.fg_vegetable_5);
		}else if(topic.equals("top_vegetable_6")){
			setActionBarContentView(R.layout.fg_vegetable_6);
		}else if(topic.equals("top_protein_1")){
			setActionBarContentView(R.layout.fg_protein_1);
		}else if(topic.equals("top_protein_2")){
			setActionBarContentView(R.layout.fg_protein_2);
		}else if(topic.equals("top_protein_3")){
			setActionBarContentView(R.layout.fg_protein_3);
		}else if(topic.equals("top_protein_4")){
			setActionBarContentView(R.layout.fg_protein_4);
		}else if(topic.equals("top_protein_5")){
			setActionBarContentView(R.layout.fg_protein_5);
		}else if(topic.equals("top_protein_6")){
			setActionBarContentView(R.layout.fg_protein_6);
		}else if(topic.equals("top_dairy_1")){
			setActionBarContentView(R.layout.fg_dairy_1);
		}else if(topic.equals("top_dairy_2")){
			setActionBarContentView(R.layout.fg_dairy_2);
		}else if(topic.equals("top_dairy_3")){
			setActionBarContentView(R.layout.fg_dairy_3);
		}else if(topic.equals("top_dairy_4")){
			setActionBarContentView(R.layout.fg_dairy_4);
		}else if(topic.equals("top_dairy_5")){
			setActionBarContentView(R.layout.fg_dairy_5);
		}
	}
	
	private void initActionBar(){
		getActionBar().setTitle("Topics");
        getActionBar().setBackgroundColor(Color.rgb(82, 135, 241));
        getActionBar().getChildAt(0).
    	setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(ShowTopicActivity.this,HomeActivity.class);	
				startActivity(intent);
			}}); 
	}
}
